package com.server;

import com.doman.TeaConditions;
import com.doman.Teacher;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface TeacherMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Teacher record);

    int insertSelective(Teacher record);

    Teacher selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Teacher record);

    int updateByPrimaryKey(Teacher record);

    //查询老师表中的code+名称是否相同
    Teacher selectByPrimaryBindcodeAndTeacherName(Teacher teacher);

    //根据code查询老师信息
    Teacher selectByPrimaryByCode(Teacher teacher);

    //根据code修改老师信息
    int updateByPrimaryByCodeUpdate(Teacher teacher);

    //根据openid查询老师信息
    List<Teacher> selectByPrimaryByOpenid(Teacher teacher);

    //根据openid修改老师信息
    int updateByPrimaryByOpenidUpdate(Teacher teacher);


    //-cms----

    /**
     * 查询所有教师
     * @return
     */
    List<Teacher> selectAll();

    /**
     * 查询所有教师
     * @return
     */
    List<Teacher> selectByCondition(TeaConditions teaConditions);

//    /**
//     * 按照绑定码更新教师数据
//     * @param teacher
//     * @return
//     */
//    int updateByBindCode(Teacher teacher);

    /**
     * 删除教师数据by绑定码
     * @param bindcode
     * @return
     */
    int delByBindCode(String bindcode);
}